class Modal extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      content: this.props.content
    };
  }


  click() {
    this.props.click()
  }

  componentWillReceiveProps(e) {

    this.setState({ content: e.content })

  }
  componentDidMount() {

    var that = this;
  }
  render() {
    return (
      <div className="modal fade" id="myModal" >
        <div className="modal-dialog modal-sm">
          <div className="modal-content">
            <div className="modal-header">
              <h4 className="modal-title">提示</h4>
            </div>
            <div className="modal-body">
              {this.state.content}
            </div>
            <div className="modal-footer">
              <button type="button" onClick={this.click.bind(this)} className="btn btn-primary">确定</button>
              <button type="button" className="btn btn-secondary" data-dismiss="modal">关闭</button>
            </div>

          </div>
        </div>
      </div>
    )
  }
}